package com.maple.phonewardweb.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.xml.ws.Endpoint;

import com.maple.phonewardweb.webservice.HelloImpl;

/**
 * InitListener.java
 * 
 * @author: YaJian Qiu
 * @Time 2013-3-22 上午9:56:13<br>
 *       本类描述: 应用启动监听器，用于初始化应用数据
 */
public class InitListener implements ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		//应用启动时执行
		ServletContext sc = sce.getServletContext();
		String wsUrl = sc.getInitParameter("wsUrl");
		Endpoint.publish(wsUrl, new HelloImpl());
		System.out.println("WebService发布成功...");
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		//应用销毁时执行
	
	}

}
